package com.situ.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.List;

@Data
@Builder
@Schema(description = "运营数据统计报表对象")
@AllArgsConstructor
@NoArgsConstructor
public class BussinessReportVO {

    @Schema(description = "会员数据统计")
    private UserReport userReport;

    @Schema(description = "订单数据统计")
    private OrderReport orderReport;

    @Schema(description = "热门商品统计")
    private List<HotProduct> hotProduct;

    @Schema(description = "报表日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate reportDate;

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(description = "会员数据统计")
    public static class UserReport {
        @Schema(description = "今日新增会员数")
        private Long todayNewMember;

        @Schema(description = "总会员数")
        private Long totalMember;

        @Schema(description = "本周新增会员数")
        private Long thisWeekNewMember;

        @Schema(description = "本月新增会员数")
        private Long thisMonthNewMember;
    }

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(description = "订单数据统计")
    public static class OrderReport {
        @Schema(description = "今日新增订单数")
        private Long todayNewOrder;

        @Schema(description = "本周新增订单数")
        private Long thisWeekNewOrder;
    }

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(description = "热门商品统计")
    public static class HotProduct{
        @Schema(description = "商品名称")
        private String title;

        @Schema(description = "购买数量")
        private Integer totalNum;

        @Schema(description = "占比")
        private Double present;

        @Schema(description = "备注")
        private String sellPoint;
    }
}
